package com.gues.ddc_app.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gues.ddc_app.entity.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gues.ddc_app.entity.Orders;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huHang
 * @since 2023-02-12
 */
public interface MenuMapper extends BaseMapper<Menu> {
    @Select("SELECT m.*,shop_name AS 'shop.shopName' FROM menu m inner join shop s on m.shop_id = s.shop_id ${ew.customSqlSegment}")
    <E extends IPage<Menu>> E queryByCondition(E page, @Param("ew") Wrapper<Menu> queryWrapper);
    @Select("SELECT m.*,shop_name AS 'shop.shopName' FROM menu m inner join shop s on m.shop_id = s.shop_id ${ew.customSqlSegment}")
    public List<Menu> getList(@Param("ew") Wrapper<Menu> wrapper);
}
